package com.fishery.customization.service.impl;

import com.fishery.customization.dao.DragLabelDao;
import com.fishery.customization.entity.DragLabel;
import com.fishery.customization.entity.LabelSequence;
import com.fishery.customization.service.DragLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DragLabelServiceImpl implements DragLabelService {

	@Autowired
	private DragLabelDao dragLabelDao;

	@Override
	public List<LabelSequence> getLabelSequenceByUserId(String userId) {
		return dragLabelDao.findLabelSequenceByUserId(userId);
	}

	@Override
	public boolean saveOrUpdateDragLabelByUserId(DragLabel dragLabel) {
		return dragLabelDao.upsertDragLabelByUserId(dragLabel) > 0;
	}
}
